/*w我的页面  头部*/

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:frametrim/app/app_navigator.dart';
import 'package:frametrim/utility/screen.dart';
import 'package:frametrim/utility/sq_color.dart';

import 'minemarkView.dart';

class MineHeaderView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: Screen.width,
      margin: EdgeInsets.only(top: 25,left: 12),
      height: 100,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          buildAvatar(),
          SizedBox(
            width: 15,
          ),
          buildCenter(),
          Expanded(child: Container()),
          buildRight(context)
        ],
      ),
    );
  }

  Widget buildAvatar() {
    return Container(
      width: 60,
      height: 60,
      decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(30),
          color: Colors.white,
          border: Border.all(color: Colors.white, width: 0.5)),
      child: CircleAvatar(
        radius: 30,
        // backgroundImage: Image.asset('image/default_avatar.png'),
        child: Image.asset('image/default_avatar.png'),
      ),
    );
  }

  Widget buildCenter() {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Text(
            '张传',
            style: TextStyle(fontSize: 20, color: SQColor.color_222222),
          ),
          SizedBox(
            height: 5,
          ),
          Row(
            children: <Widget>[
              Image.asset(
                'image/icon_sm_auth.png',
                width: 76,
                height: 20,
              ),
              SizedBox(
                width: 10,
              ),
              Image.asset(
                'image/icon_pt_auth.png',
                width: 76,
                height: 20,
              ),
            ],
          ),
          SizedBox(
            height: 10,
          ),
          Row(
            children: <Widget>[
              Image.asset(
                'image/icon_mine_phone.png',
                width: 11,
                height: 13.44,
              ),
              SizedBox(
                width: 5,
              ),
              Text(
                '18339995540',
                style: TextStyle(fontSize: 13, color: SQColor.color_333333),
              )
            ],
          ),
        ],
      ),
    );


  }
  Widget buildRight(BuildContext context){
    return GestureDetector(
      onTap: (){
        AppNavigator.pushWeb(context, 'http://h5.qidianzhuyun.com/rcbapp/#/user');
      },
      child: Container(
        margin: EdgeInsets.only(top: 10),
        width: 92,
        height: 32,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          image: DecorationImage(//min_icon1
            image: AssetImage('image/min_icon1.png'),
            fit: BoxFit.fill, // 完全填充
          ),
        ),
        child: Center(
          child: Text('个人信息',style: TextStyle(fontSize: 14,color: SQColor.black),),
        ),
      ),
    );
  }
}
